import request from '@/utils/request'

export function getResultDetail(data) {
    return request({
        url: '/renovation/completedSurvey/firstAudit/baseDate',
        method: 'post',
        load: true,
        formData:data
    })
}
export function exportDrawingOpinions(data) {
    const url = makeQueryToPrams('/renovation/drawingAuditAdvice/export', data)
    return request({
        url: url,
        method: 'get',
        responseType:'blob'
    })
}

export function checkReviewOpinion(data) {
    return request({
        url: '/renovation/completedSurvey/firstAudit/submit',
        method: 'post',
        load: true,
        formData:data
    })
}

export function checkReviewReOpinion(data) {
    return request({
        url: '/renovation/completedSurvey/review/submit',
        method: 'post',
        load: true,
        formData:data
    })
}
// 复审综合监管信息
export function getlaterSupervisingInfo(data) {
    return request({
      url: `/renovation/completedSurvey/later_supervising_info`,
      method: 'post',
      json: data
    })
  }


// 处理参数为url query方式
function makeQueryToPrams(url, data) {
    let link = url
    if(link.indexOf('?') == -1) {
        link += '?'
    }
    for (let i in data) {
        link += i + '=' + data[i] + '&'
    }
    return link
}